<?php $this->load->view('inc/top.php');?>
<style>
.error {color:red;}
</style>
<script type="text/javascript">
<!--
	function checkLogin(){
		var data = $('#keyForm').serialize();
		//alert(data);
			$.ajax({
				type : 'POST',
				url : 'clogin/checkLogin',
				data : data,
				success : function(string){
					if(string==1){
						window.location.assign("cproduct/index");
					}else{
						$('.error').html('Wrong username or password');
					}
				}
				});
		}
//-->
</script>
  <div id="templatemo_content">
  	<div id="templatemo_content_left">
  		<div class="error"></div>
		<div>
			<?php
			$formAttribute = array('id' => 'keyForm');
			$js = 'onClick="checkLogin()"';
			echo form_open('checkLogin',$formAttribute);
			echo form_fieldset('Login Form');
			echo form_label('Username :');
			echo form_input('username');
			echo "<br>";
			echo form_label('Password');
			echo form_password('password');
			echo "<br>";
			echo form_button('loginButton','Log in',$js);
			echo form_fieldset_close();
		?>
		</div>
	</div>
<?php $this->load->view('inc/right.php');?>
<?php $this->load->view('inc/bottom.php');?>
